package com.company.fegin.fallback;

import com.company.fegin.Impl.ShopClientImpl;
import com.company.fegin.ShopClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author yinxing
 * @date 2022-08-05
 */
@Component
@Slf4j
public class SearchFallbackFactory implements FallbackFactory<ShopClient> {

    @Autowired
    private ShopClientImpl shopClient;

    @Override
    public ShopClient create(Throwable throwable) {
        log.info("======================shop错误信息=========================");
        throwable.printStackTrace();
        return shopClient;
    }
}
